package com.jiyun.controller.goods;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
public class LoginController {
    @GetMapping("/name")
    public String showName() {
        String name =
                SecurityContextHolder.getContext().getAuthentication().getName();

        return name;
    }
}